package com.meij.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.meij.fragment.PicListFragment;
import com.meij.fragment.PlaceholderFragment;
import com.meij.fragment.UserInfoFragment;

public class UserCenterPagerAdapter extends FragmentPagerAdapter {
	private UserInfoFragment userInfoFragment;
	private PicListFragment picListFragment;

	public UserCenterPagerAdapter(FragmentManager fm) {
		super(fm);
		userInfoFragment = new UserInfoFragment();
		picListFragment = new PicListFragment();
	}

	@Override
	public Fragment getItem(int position) {
		switch (position) {
		case 0:
			return userInfoFragment;
		case 1:
			return picListFragment;
		case 2:
			break;
		}
		return PlaceholderFragment.newInstance(position + 1);
	}

	@Override
	public int getCount() {
		return 3;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		switch (position) {
		case 0:
			return "个人信息";
		case 1:
			return "相册";
		case 2:
			return "个人秀";
		}
		return null;
	}
}